<template>
  <div>
    <el-form :inline="true" :model="formData">
      <el-form-item>
        <el-input v-model="formData.name" placeholder="输入机构名称或者拼音首字母"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="search" @click="handleSearch()">搜索</el-button>
        <el-button type="primary" icon="plus" @click="handleAdd()">新增</el-button>
      </el-form-item>
    </el-form>

    <el-table v-loading.body="loading" :data="tableData" border>
      <el-table-column prop="name" label="发布日期" align="center"></el-table-column>
      <el-table-column prop="type" label="发布标题" align="center"></el-table-column>
      <el-table-column prop="way" label="发布内容" align="center"></el-table-column>
      <el-table-column prop="num" label="发布对象" align="center"></el-table-column>
      <el-table-column prop="appkey" label="更新状况" align="center"></el-table-column>
      <el-table-column label="操作" align="center" width="200">
        <template slot-scope="scope">
          <el-button type="text" @click="handleGoMachine(scope.$index, scope.row)">更新反馈</el-button>
          <el-button type="text" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
        </template>
      </el-table-column>
    </el-table>

    <Pagination />
  </div>
</template>

<script>
  import {mixins} from "@/core";

  export default {
    mixins: [mixins],
    data () {
      return {
        formData: {
          name: ""
        },
        API: {
          query: "http://localhost:8090/static/organization.json"
        }
      }
    },
    methods: {
      handleGoMachine (index, row) {
        this.$router.push(`/channel/machine?id=${row.id}`);
      }
    }
  }
</script>

<style scoped lang="scss">
    .el-form /deep/ .el-input__inner {
      width: 620px;
      border: none;
    }
</style>
